<template>
	<view class="grid-wap u-m-b-10 u-flex-col u-flex-wrap" v-if="list.length">
		<view class="grid-item u-flex u-col-center u-row-between" v-for="(menu, index) in gridList" :key="index"
			@tap="jump(menu)">
			<view class="u-flex u-col-center">
				<image class="tool-img" :src="menu.image" mode="aspectFill"></image>
				<view class="item-title">{{ menu.name }}</view>
			</view>
			<view class="u-iconfont uicon-arrow-right" style="color: rgb(153,153,153,0.8);font-size: 26rpx;"></view>
		</view>

	</view>
</template>

<script>
	import {
		mapGetters
	} from "vuex";
	/**
	 * shGrid-宫格列表
	 * @property {Array} list  - 宫格列表
	 */
	export default {
		components: {},
		data() {
			return {
				gridList: []
			};
		},
		computed: {
			...mapGetters(["userInfo"])
		},
		props: {
			list: {
				type: Array,
				default: () => {
					return [];
				}
			}
		},
		created() {
			this.gridList = this.list
			if (!this.userInfo.mobile) {
				this.gridList.shift()
				this.$emit('update:list', this.gridList)
				// this.$forceUpdate()
			}
		},
		mounted() {


		},
		methods: {
			jump(data) {
				this.$tools.routerTo(data.path);
			}
		}
	};
</script>

<style lang="scss">
	// 宫格
	.grid-wap {
		background: #fff;
		width: 750rpx;
		padding: 0 30rpx;
		margin-top: 15rpx;

		.grid-item {
			width: 100%;
			// margin-bottom: 40rpx;
			height: 100rpx;
			line-height: 100rpx;
			border-bottom: 1rpx solid #f6f6f6;

			.tool-img {
				width: 44rpx;
				height: 44rpx;
			}

			.item-title {
				font-size: 26rpx;
				font-weight: 500;
				color: rgba(153, 153, 153, 1);
				line-height: 24rpx;
				margin-left: 13rpx;
				// padding-top: 20rpx;
			}
		}
	}
</style>